CREATE TABLE [dbo].[tb_RegistroEventos]
(
[idRegistroEventos] [int] NOT NULL IDENTITY(1, 1),
[fecha] [datetime] NOT NULL,
[idUsuario1] [int] NOT NULL,
[severidad] [int] NOT NULL,
[causa] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[idUsuario2] [int] NULL,
[descripcion] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_RegistroEventos] ADD CONSTRAINT [PK_tb_RegistroEventos] PRIMARY KEY CLUSTERED  ([idRegistroEventos]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_RegistroEventos] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroEventos_tb_Usuarios] FOREIGN KEY ([idUsuario1]) REFERENCES [dbo].[tb_Usuarios] ([idUsuario]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[tb_RegistroEventos] WITH NOCHECK ADD CONSTRAINT [FK_tb_RegistroEventos_tb_Usuarios1] FOREIGN KEY ([idUsuario2]) REFERENCES [dbo].[tb_Usuarios] ([idUsuario]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[tb_RegistroEventos] NOCHECK CONSTRAINT [FK_tb_RegistroEventos_tb_Usuarios]
GO
ALTER TABLE [dbo].[tb_RegistroEventos] NOCHECK CONSTRAINT [FK_tb_RegistroEventos_tb_Usuarios1]
GO
